//package com.example.springboot.RabbitMQ.BasicOperation;
//
//import com.rabbitmq.client.BuiltinExchangeType;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
//// 主题交换机使用模式匹配来路由消息，
//// Topic中，通过.将routingKey分为多个部分 ,路由键和绑定键都支持通配符*（表示一个词）和#（表示一个或多个词）。
//// 应用场景：适合主题订阅模型，例如邮件分类、日志级别过滤等。
//// 绑定规则：使用模式匹配的绑定键，例如*.info或#.error。
//
//@Component
//public class TopicDome {
//
//    @Autowired
//    private static BasicOperation basicOperation;
//
//    private static String exchangeName = "exchange_Topic_01";
//    private static String queueName_01 = "queue_Topic_01";
//    private static String queueName_02 = "queue_Topic_02";
//    private static String queueName_03 = "queue_Topic_03";
//    private static String queueName_04 = "queue_Topic_04";
//    private static String routingKey_01 = "key1.key2.key3.*";
//    private static String routingKey_02 = "key1.#";
//    private static String routingKey_03 = "*.key2.*.key4";
//    private static String routingKey_04 = "#.key3.key4";
//    private static BuiltinExchangeType builtinExchangeType = BuiltinExchangeType.TOPIC;
//
//    public void builder() throws IOException {
//
//        basicOperation.createExchange(exchangeName,builtinExchangeType,true,false,null);
//
//        basicOperation.createQueue(queueName_01,true,false,false,null);
//        basicOperation.createQueue(queueName_02,true,false,false,null);
//        basicOperation.createQueue(queueName_03,true,false,false,null);
//        basicOperation.createQueue(queueName_04,true,false,false,null);
//
//        basicOperation.queueBind(queueName_01,exchangeName,routingKey_01);
//        basicOperation.queueBind(queueName_02,exchangeName,routingKey_02);
//        basicOperation.queueBind(queueName_03,exchangeName,routingKey_03);
//        basicOperation.queueBind(queueName_04,exchangeName,routingKey_04);
//
//    }
//
//    public void sendMsg() throws IOException {
//
//        String message_01 = "Hello queues";
//
//        basicOperation.sendMsg(exchangeName,"key1.key2.key3.key4",null,message_01);
//
//    }
//
//    public void receiveMsg() throws IOException {
//
//        basicOperation.receiveMsg(queueName_01);
//        basicOperation.receiveMsg(queueName_02);
//        basicOperation.receiveMsg(queueName_03);
//        basicOperation.receiveMsg(queueName_04);
//
//    }
//
//
//
//}
